POV-Ray : Newsgroups : povray.general : Improving POV-Ray. : Re: Improving POV-Ray. Server Time
12 Aug 2024 19:31:48 EDT (-0400)
  Re: Improving POV-Ray.  
From: Dick Balaska
Date: 21 Feb 1999 20:49:30
Message: <36D0B79E.D5AF47B0@buckosoft.com>
Spider wrote:
> 
> Rudy Velthuis wrote:

> 
> > I've
> > however seen one example, where optimized Pascal code was *faster* than the
> > original hand-optimized assembler routine. This was also a string function.
> > It was the improved algorithm which did the trick.
> 
> Show me that pascal code, please.

I agree.  I'll bet real money that i can code any algorithm in asm
to run faster than a high level language. Although it's been 10 years
since
i've done my last 80386 device driver, i still occasionally have to slop 
my way stepping through optimized compiler output.  I am always
surprised
to see array indexes calculated with multiplys instead of shifts.
Also, C function calls always pay the price of building a stack frame.
push ebp ; mov ebp, esp ; is a very slow operation.  Stack operations
are slow, passing arguments in registers is much faster. In the case
of the 8080 and all of it's descendents, the chip is designed to have
specific arguments passed in specific registers.
Now pentiums are designed with dual pipelines and prefetch queues,
most of whose advantage is negated by constant test-branch logic.

On the other hand, i don't want to ever write assembler again.
I'd rather just buy a faster computer :)

* No problem is too large that a faster clock rate can't fix.

dik


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.